<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>QUAN LY THEM XE</title>
</head>  
<script language="JavaScript">
	function KiemTraMX() {
		if (a.MaXe.value.length > 10)
			alert("Bạn da go qua so ki tu cho phep !");
	}
	function CheckSo(evt)
	{
		var charCode=(evt.which)?evt.which:event.keyCode
				if(charCode>31&& (charCode<48||charCode>57))
					return false;
		return true;
	}

	function KiemTra(){
		var err = "";
		if (a.MaXe.value == "") {
			err += " MA XE ";

		}

		if (a.TenXe.value == "") {
			err += " TEN XE ";

		}
		if (a.HangXe.value == "") {
			err += " HANG XE ";

		}
		if (a.MauSac.value == "") {
			err += " MAU SAC";

		}
		if (a.LoaiXe.value == "") {
			err += " LOAI XE ";

		}
		if (a.SoMay.value == "") {
			err += "  SO MAY ";

		}
		if (a.SoKhung.value == "") {
			err += " SO KHUNG ";

		}
		if (a.DTXilanh.value == "") {
			err += " SO KHUNG ";

		}
		if (a.TrangThai.value == "") {
			err += " TRANG THAI ";

		}
		if (a.SoKm.value == "") {
			err += " SO KM ";

		}
		if (a.Gia.value == "") {
			err += " Gia ";

		}
		if (a.Hinh.value == "") {
			err += " HINH";

		}
		if (err != "") {
			alert("BAN KHONG DUOC BO TRONG :  " + err);
		}

	}
</script>
<body>
	<form action="" name="a" onsubmit="return kiemtra();" action="">
		<table width="399" border="2" align="center" cellpadding="5"
			cellspacing="5">
			<tr>
				<th colspan="2" scope="col">THEM THONG TIN XE</th>
			</tr>
			<tr>
				<td width="131">Ma Xe</td>
				<td width="225"><label for="MaXe"></label> <input type="text"
					name="maxe" id="MaXe" onKeyUp="KiemTraMX();" /></td>
			</tr>
			<tr>
				<td width="131">Ten Xe</td>
				<td width="225"><label for="TenXe"></label> <input
					type="text" name="TenXe" id="TenXe" /></td>
			</tr>
			<tr>
				<td width="131">Hang Xe</td>
				<td width="225"><label for="HangXe"></label> <input
					type="text" name="HangXe" id="HangXe" /></td>
			</tr>
			<tr>
				<td width="131">Mau Sac</td>
				<td width="225"><label for="MauSac"></label> <input type="text"
					name="MauSac" id="MauSac" /></td>
			</tr>
			<tr>
				<td width="131">Loai Xe</td>
				<td width="225"><label for="LoaiXe"></label> <input type="text"
					name="LoaiXe" id="LoaiXe" /></td>
			</tr>
			<tr>
				<td width="131">So May</td>
				<td width="225"><label for="SoMay"></label> <input
					type="text" name="SoMay" id="SoMay" onkeydown="return CheckSo(event)"/></td>
			</tr>
			<tr>
				<td width="131">So Khung</td>
				<td width="225"><label for="SoKhung"></label> <input type="text"
					name="SoKhung" id="SoKhung" onkeydown="return CheckSo(event)"/></td>
			</tr>
			<tr>
				<td width="131">Dung Tich Xi Lanh</td>
				<td width="225"><label for="DTXilanh"></label> <input
					type="text" name="DTXilanh" id="DTXilanh" /></td>
			</tr>
			<tr>
				<td width="131">Trang Thai</td>
				<td width="225"><label for="TrangThai"></label> <input
					type="text" name="trangthai" id="trangthai" /></td>
			</tr>
			<tr>
				<td width="131">So Km</td>
				<td width="225"><label for="SoKm"></label> <input
					type="text" name="SoKm" id="SKkm" /></td>
			</tr>
			<tr>
				<td width="131">Gia</td>
				<td width="225"><label for="Gia"></label> <input
					type="text" name="Gia" id="Gia" /></td>
			</tr>
			<tr>
				<td width="131">Hinh</td>
				<td width="225"><label for="Hinh"></label> <input
					type="text" name="hinh" id="Hinh" /></td>
			</tr>
			<tr>
				<td><div align="right"></div></td>
				<td><input type="submit" name="Submit" value="SAVE "
					onclick="KiemTra()" /> <input type="reset" name="Submit2"
					value="HUY" /></td>
			</tr>
		</table>
	</form>

</body>
</html>